<template>

<h2>医生个人简历</h2>
<table border="1">
    <tr>
            <td>医生名称</td>
            <td>
                <input type="text" v-model="info.DoctorName">
            </td>
        </tr>
        <tr>
            <td>学历</td>
            <td>
                <select v-model="info.College">
                    <option value="研究生">研究生</option>
                    <option value="博士">博士</option>
                    <option value="本科">本科</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>职称</td>
            <td>
                <select v-model="info.Pos">
                    <option value="主任医师">主任医师</option>
                    <option value="副主任">副主任</option>
                    <option value="医生">医生</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>医生照片</td>
            <td>
               
                <img  style="width: 60px;height: 60px;" :src="info.DoctorImg">
    
            </td>
        </tr>
        <tr>
            <td>科室</td>
            <td>
                <select v-model="info.KeiShiId">
                    <option :value="0">--请选择--</option>
                    <option v-for="item in Kei" :value="item.KeiShiId">{{ item.KeiShiName }}</option>
                </select>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
             
            </td>
        </tr>
    </table>

</template>
<script setup lang="ts">
import axios from "axios";
import { onMounted ,ref} from "vue";
import { useRoute } from "vue-router";

const route=useRoute();

const info=ref({
    DoctorName:"",
    College:"",
    Pos:"",
    DoctorImg:"",
    KeiShiId:0

})

const Kei=ref([{
    KeiShiId:0,
    KeiShiName:""

}])

onMounted(()=>{
    Lodata();
    GetDoctor();
})
//下拉框
const Lodata=()=>{
    axios.get('https://localhost:7133/api/Doctor/GetKeiShis')
    .then(res=>{
        Kei.value=res.data
    })
}

const GetDoctor=()=>{
    axios.get('https://localhost:7133/api/Doctor/GetDoctor',
    {
        params:{
            DoctorId:route.params.id
        }
    }
    )
    .then(res=>{
        info.value= res.data
    })
}

//上传
// const UpLoad=(e:any)=>{

// var file=e.target.files[0];
// var fd=new FormData();

// fd.append("img",file);

// axios.post('https://localhost:7133/api/Files/FilesUpLoad',fd)
// .then(res=>{
//     info.value.DoctorImg=res.data
// })

// }

</script>